<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="author" content="李愧愧">
    <title></title>
    <style>
        @font-face {
            font-family: 'time';
            src: url('./Digital Dismay.otf');
        }

       
    </style>
</head>

<body>
    <!-- <div>
        <div>
            17:05:09
        </div>
        <p>
            2020年08月24日 星期一
        </p>
    </div> -->
    <script>
        var body = document.body;
        var div = document.createElement('div');
        body.appendChild(div);
        var div1 = document.createElement('div');
        div.appendChild(div1);
        var p = document.createElement('p');
        div.appendChild(p);
        div.style.cssText =
            'background-color: #333333;width: 674px;height: 325px;margin: 0 auto;border: 1px solid #333333;'
        div1.style.cssText =
            'width: 435px;height: 90px;color: #ffff00;font-family: time;font-size: 130px;margin-top: 30px;margin-left: 100px;'
        p.style.cssText =
            'text-align: right;color: #007610;font-size: 25px;font-weight: bold;margin-top: 100px;margin-right: 50px;'

        function data() {
            var now = new Date();
            var hours = now.getHours();
            var minute = now.getMinutes();
            var second = now.getSeconds();
            var year = now.getUTCFullYear();
            var month = now.getMonth() + 1;
            var data = now.getDate();
            var week = now.getDay();
            if(hours<10){
                hours='0'+hours;
            }
            if(minute<10){
                minute='0'+minute;
            }
            if(second<10){
                second='0'+second;
            }
            if(month<10){
                month='0'+month;
            }
            if(data <10){
                data ='0'+data ;
            }
            switch (week) {
                case 0:
                    week = "星期日"
                    break;
                case 1:
                    week = "星期一"
                    break;
                case 2:
                    week = "星期二"
                    break;
                case 3:
                    week = "星期三"
                    break;
                case 4:
                    week = "星期四"
                    break;
                case 5:
                    week = "星期五"
                    break;
                case 6:
                    week = "星期六"
                    break;
                default:
                    break;
            }
            div1.innerHTML=hours+':'+minute+':'+second;
            p.innerHTML=year+'年'+month+'月'+data+'日'+'  '+week;
        }
        data();
        setInterval(data,1000);
    </script>
</body>

</html>